<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>NMQJ: TiXmlPrinter Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">NMQJ
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">TiXmlPrinter Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="TiXmlPrinter" --><!-- doxytag: inherits="TiXmlVisitor" -->
<p><code>#include &lt;<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for TiXmlPrinter:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classTiXmlPrinter.png" usemap="#TiXmlPrinter_map" alt=""/>
  <map id="TiXmlPrinter_map" name="TiXmlPrinter_map">
<area href="classTiXmlVisitor.html" alt="TiXmlVisitor" shape="rect" coords="0,0,81,24"/>
</map>
 </div></div>

<p><a href="classTiXmlPrinter-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a799f4f0388570cbb54c0d3c345fef7c1"></a><!-- doxytag: member="TiXmlPrinter::VisitEnter" ref="a799f4f0388570cbb54c0d3c345fef7c1" args="(const TiXmlDocument &amp;doc)" -->
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a799f4f0388570cbb54c0d3c345fef7c1">VisitEnter</a> (const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> &amp;doc)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Visit a document. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a66b33edd76c538b462f789b797a4fdf2"></a><!-- doxytag: member="TiXmlPrinter::VisitExit" ref="a66b33edd76c538b462f789b797a4fdf2" args="(const TiXmlDocument &amp;doc)" -->
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a66b33edd76c538b462f789b797a4fdf2">VisitExit</a> (const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> &amp;doc)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Visit a document. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0c5e7bf8622838417a0d0bfb8f433854"></a><!-- doxytag: member="TiXmlPrinter::VisitEnter" ref="a0c5e7bf8622838417a0d0bfb8f433854" args="(const TiXmlElement &amp;element, const TiXmlAttribute *firstAttribute)" -->
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a0c5e7bf8622838417a0d0bfb8f433854">VisitEnter</a> (const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> &amp;element, const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> *firstAttribute)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Visit an element. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1853cf2f6e63ad4b4232b4835e0acaf0"></a><!-- doxytag: member="TiXmlPrinter::VisitExit" ref="a1853cf2f6e63ad4b4232b4835e0acaf0" args="(const TiXmlElement &amp;element)" -->
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a1853cf2f6e63ad4b4232b4835e0acaf0">VisitExit</a> (const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> &amp;element)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Visit an element. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ace1b14d33eede2575c0743e2350f6a38"></a><!-- doxytag: member="TiXmlPrinter::Visit" ref="ace1b14d33eede2575c0743e2350f6a38" args="(const TiXmlDeclaration &amp;declaration)" -->
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#ace1b14d33eede2575c0743e2350f6a38">Visit</a> (const <a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> &amp;declaration)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Visit a declaration. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a711e7d65d4af9ec70977568d2451fb1c"></a><!-- doxytag: member="TiXmlPrinter::Visit" ref="a711e7d65d4af9ec70977568d2451fb1c" args="(const TiXmlText &amp;text)" -->
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a711e7d65d4af9ec70977568d2451fb1c">Visit</a> (const <a class="el" href="classTiXmlText.html">TiXmlText</a> &amp;text)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Visit a text node. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a83c13d6b980064b30f989f9a35498979"></a><!-- doxytag: member="TiXmlPrinter::Visit" ref="a83c13d6b980064b30f989f9a35498979" args="(const TiXmlComment &amp;comment)" -->
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a83c13d6b980064b30f989f9a35498979">Visit</a> (const <a class="el" href="classTiXmlComment.html">TiXmlComment</a> &amp;comment)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Visit a comment node. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad2dca6dd106e8982fd3c7db1f3330970"></a><!-- doxytag: member="TiXmlPrinter::Visit" ref="ad2dca6dd106e8982fd3c7db1f3330970" args="(const TiXmlUnknown &amp;unknown)" -->
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#ad2dca6dd106e8982fd3c7db1f3330970">Visit</a> (const <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> &amp;unknown)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Visit an unknown node. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a213377a4070c7e625bae59716b089e5e">SetIndent</a> (const char *_indent)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abb33ec7d4bad6aaeb57f4304394b133d"></a><!-- doxytag: member="TiXmlPrinter::Indent" ref="abb33ec7d4bad6aaeb57f4304394b133d" args="()" -->
const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#abb33ec7d4bad6aaeb57f4304394b133d">Indent</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Query the indention string. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a4be1e37e69e3858c59635aa947174fe6">SetLineBreak</a> (const char *_lineBreak)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a11f1b4804a460b175ec244eb5724d96d"></a><!-- doxytag: member="TiXmlPrinter::LineBreak" ref="a11f1b4804a460b175ec244eb5724d96d" args="()" -->
const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a11f1b4804a460b175ec244eb5724d96d">LineBreak</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Query the current line breaking string. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#ab23a90629e374cb1cadca090468bbd19">SetStreamPrinting</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a859eede9597d3e0355b77757be48735e"></a><!-- doxytag: member="TiXmlPrinter::CStr" ref="a859eede9597d3e0355b77757be48735e" args="()" -->
const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a859eede9597d3e0355b77757be48735e">CStr</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the result. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad01375ae9199bd2f48252eaddce3039d"></a><!-- doxytag: member="TiXmlPrinter::Size" ref="ad01375ae9199bd2f48252eaddce3039d" args="()" -->
size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#ad01375ae9199bd2f48252eaddce3039d">Size</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the length of the result string. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3bd4daf44309b41f5813a833caa0d1c9"></a><!-- doxytag: member="TiXmlPrinter::Str" ref="a3bd4daf44309b41f5813a833caa0d1c9" args="()" -->
const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a3bd4daf44309b41f5813a833caa0d1c9">Str</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the result. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Print to memory functionality. The <a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a> is useful when you need to:</p>
<ol type="1">
<li>Print to memory (especially in non-STL mode)</li>
<li>Control formatting (line endings, etc.)</li>
</ol>
<p>When constructed, the <a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a> is in its default "pretty printing" mode. Before calling Accept() you can call methods to control the printing of the XML document. After <a class="el" href="classTiXmlNode.html#acc0f88b7462c6cb73809d410a4f5bb86">TiXmlNode::Accept()</a> is called, the printed document can be accessed via the <a class="el" href="classTiXmlPrinter.html#a859eede9597d3e0355b77757be48735e" title="Return the result.">CStr()</a>, <a class="el" href="classTiXmlPrinter.html#a3bd4daf44309b41f5813a833caa0d1c9" title="Return the result.">Str()</a>, and <a class="el" href="classTiXmlPrinter.html#ad01375ae9199bd2f48252eaddce3039d" title="Return the length of the result string.">Size()</a> methods.</p>
<p><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a> uses the Visitor API. </p>
<div class="fragment"><pre class="fragment">
	TiXmlPrinter printer;
	printer.SetIndent( "\t" );

	doc.Accept( &amp;printer );
	fprintf( stdout, "%s", printer.CStr() );
	</pre></div> </div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a213377a4070c7e625bae59716b089e5e"></a><!-- doxytag: member="TiXmlPrinter::SetIndent" ref="a213377a4070c7e625bae59716b089e5e" args="(const char *_indent)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classTiXmlPrinter.html#a213377a4070c7e625bae59716b089e5e">TiXmlPrinter::SetIndent</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>_indent</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Set the indent characters for printing. By default 4 spaces but tab () is also useful, or null/empty string for no indentation. </p>

</div>
</div>
<a class="anchor" id="a4be1e37e69e3858c59635aa947174fe6"></a><!-- doxytag: member="TiXmlPrinter::SetLineBreak" ref="a4be1e37e69e3858c59635aa947174fe6" args="(const char *_lineBreak)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classTiXmlPrinter.html#a4be1e37e69e3858c59635aa947174fe6">TiXmlPrinter::SetLineBreak</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>_lineBreak</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Set the line breaking string. By default set to newline (<br/>
). Some operating systems prefer other characters, or can be set to the null/empty string for no indenation. </p>

</div>
</div>
<a class="anchor" id="ab23a90629e374cb1cadca090468bbd19"></a><!-- doxytag: member="TiXmlPrinter::SetStreamPrinting" ref="ab23a90629e374cb1cadca090468bbd19" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classTiXmlPrinter.html#ab23a90629e374cb1cadca090468bbd19">TiXmlPrinter::SetStreamPrinting</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Switch over to "stream printing" which is the most dense formatting without linebreaks. Common when the XML is needed for network transmission. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
</ul>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Fri Sep 21 2012 11:15:51 for NMQJ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
